package com.galaxis.wms.query

import com.galaxis.wms.entity.BasItemType
import com.querydsl.core.types.Path
import com.querydsl.core.types.PathMetadata
import com.querydsl.core.types.dsl.DateTimePath
import com.querydsl.core.types.dsl.NumberPath
import com.querydsl.core.types.dsl.StringPath
import com.querydsl.sql.ColumnMetadata
import com.querydsl.sql.RelationalPathBase

import java.sql.Timestamp
import java.sql.Types

import static com.querydsl.core.types.PathMetadataFactory.forVariable

/**
 * 物料类型资料表(bas_item_type)
 */
@SuppressWarnings("ALL")
class QBasItemType extends RelationalPathBase<BasItemType> {
    /** bas_item_type表 */
    public static final QBasItemType basItemType = new QBasItemType("bas_item_type")

    /** 物料类型ID */
    public final NumberPath<Long> itemTypeId = createNumber("itemTypeId", Long.class)
    /** 物料类型编号 */
    public final StringPath typeCode = createString("typeCode")
    /** 物料类型名称 */
    public final StringPath typeName = createString("typeName")
    /** 父节点ID */
    public final NumberPath<Long> parentId = createNumber("parentId", Long.class)
    /** 创建者 */
    public final StringPath createBy = createString("createBy")
    /** 创建时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class)
    /** 更新者 */
    public final StringPath updateBy = createString("updateBy")
    /** 更新时间 */
    public final DateTimePath<Timestamp> updateAt = createDateTime("updateAt", Timestamp.class)

    QBasItemType(String variable) {
        super(BasItemType.class, forVariable(variable), "public", "bas_item_type")
        addMetadata()
    }

    QBasItemType(String variable, String schema, String table) {
        super(BasItemType.class, forVariable(variable), schema, table)
        addMetadata()
    }

    QBasItemType(String variable, String schema) {
        super(BasItemType.class, forVariable(variable), schema, "bas_item_type")
        addMetadata()
    }

    QBasItemType(Path<? extends BasItemType> path) {
        super(path.getType(), path.getMetadata(), "public", "bas_item_type")
        addMetadata()
    }

    QBasItemType(PathMetadata metadata) {
        super(BasItemType.class, metadata, "public", "bas_item_type")
        addMetadata()
    }

    void addMetadata() {
        addMetadata(itemTypeId, ColumnMetadata.named("item_type_id").withIndex(1).ofType(Types.BIGINT).withSize(64))
        addMetadata(typeCode, ColumnMetadata.named("type_code").withIndex(2).ofType(Types.VARCHAR).withSize(64))
        addMetadata(typeName, ColumnMetadata.named("type_name").withIndex(3).ofType(Types.VARCHAR).withSize(128))
        addMetadata(parentId, ColumnMetadata.named("parent_id").withIndex(4).ofType(Types.BIGINT).withSize(64))
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(5).ofType(Types.VARCHAR).withSize(64))
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(6).ofType(Types.TIMESTAMP).withSize(100))
        addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(7).ofType(Types.VARCHAR).withSize(64))
        addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(8).ofType(Types.TIMESTAMP).withSize(100))
    }
}
